package com.token.sysflow.enumerate;

/**
 * @author chenjianxiong
 * @date 2020/4/21
 */
public enum HSWayEnum {
    ALL("all","全体通过"),
    KEY("key","关键路径"),
    MOST("most","少数服从多数"),
    NUM("num","指定个数");

    private final String key;
    private final String name;
    HSWayEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    public String getName(){
        return name;
    }


    public static HSWayEnum getHSWayByValue(String value){
        for (HSWayEnum enums : HSWayEnum.values()) {
            if (enums.getKey().equals(value)) {
                return enums;
            }
        }
        return null;
    }
}
